<%@ page pageEncoding="UTF-8"%>
<%@page import="com.utils.StringTool"%>
<%@page import="com.vinatech.util.*"%>
<%@page import="com.base.DatabaseObject"%>
<%@page import="java.math.BigDecimal"%>
<%@include file="inc-meta.jsp"%>
<html>
<html>
  <head>    
    <title>Register</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  <body>
  <%
	boolean ins = false;
	String user = "";
	String pass = "";
	String repass = "";
	user = request.getParameter("username");
	pass = request.getParameter("password");
	repass = request.getParameter("repassword");
	if(pass.equals(repass))
	{
		pass = MD5.toBase64(pass.getBytes());
		ins = contentDAO.insertUserInfo(user,pass);
		if(ins)
		{
			System.out.println("Đăng ký thành công");
			response.sendRedirect("formLogin.jsp");	
		}
	}else{
		response.sendRedirect("formRegister.jsp");	
		System.out.println("Pass phai trung nhau");
	}
  %>
  </body>
</html>
